<template>
  <div>
    <div class="box">
      <van-nav-bar left-arrow style="background: blue" class="header_bar">
        <template #left>
          <van-icon name="arrow-left" color="#fff" size="20" />
        </template>
        <template #title>
          <span style="color: #fff">客户详情</span>
        </template>
        <template #right>
          <van-icon name="wap-home-o" color="#fff" size="1.8rem" />
        </template>
      </van-nav-bar>

      <div class="headers">
        <div class="headers_box">
          <span class="headPortrait"></span>
          <span class="user">{{userObj.custName}}</span>
          <div class="bj" @click="complie">
            <van-icon name="todo-list-o" />
            编辑信息
          </div>
        </div>
      </div>

      <div class="foots">
        <div class="f1"><span class="logo1"></span>基本消息</div>
        <div>客户名称<span>{{userObj.custName}}</span></div>
        <div>联系电话<span>{{userObj.telephone}}</span></div>
        <div>学历<span>{{userObj.education}}</span></div>
        <div>性别<span>{{userObj.sex}}</span></div>
        <div>年龄<span>{{userObj.age}}</span></div>
        <div>所属城市<span>{{userObj.cityName}}</span></div>
        <div>公司名称<span>{{userObj.company}}</span></div>
        <div>职位<span>{{userObj.position}}</span></div>
        <div>录入时间<span>{{userObj.createTime}}</span></div>
      </div>
    </div>
  </div>
</template>

<script>
import { getCustData } from "@/request/api";
export default {
  data() {
    return {
        userObj:{}
    };
  },
  created() {
    console.log("打印", String(this.$route.query.id));
    getCustData({
      id: this.$route.query.id,
    }).then((res) => {
      if (res.errCode == 0) {
        console.log("获取", res.data);
        this.userObj = res.data
      }
    });
  },
  methods:{
      complie(){
          this.$router.push({path:'/compile',query:{val:this.userObj}})
      }
  }
};
</script>

<style scoped>
.box {
  position: relative;
}
.header_bar {
  width: 100%;
  height: 12rem;
}
.headers {
  width: 91%;
  position: absolute;
  top: 4rem;
  left: 2rem;
  z-index: 9999;
}
.headers_box {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}
.headPortrait {
  width: 3.5rem;
  height: 3.5rem;
  display: inline-block;
  background: url("../assets/头像.png") no-repeat;
  background-size: 100% 100%;
}
.user {
  flex: 1;
  margin-left: 1rem;
}
.bj {
  border: 1px solid #ccc;
  border-radius: 1rem 0 0 1rem;
  padding: 0.4rem;
}
.foots {
  width: 90%;
  padding: 1rem;
  box-sizing: border-box;
  position: absolute;
  bottom: -18rem;
  left: 1rem;
  z-index: 9999;
  background: #fff;
  border-radius: 0.8rem;
}
.foots div {
  margin: 0.5rem 0;
}
.foots span {
  margin-left: 0.5rem;
}
.f1 {
  display: flex;
  align-items: center;
}
.logo1 {
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  background: url("../assets/基本信息.png") no-repeat;
  background-size: 100% 100%;
  margin: 0 0.5rem 0 0 !important;
}
</style>